/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author wyr
 */
@Embeddable
public class NewsQuestionAnswerPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "questionid")
    private int questionid;
    @Basic(optional = false)
    @Column(name = "answerid")
    private int answerid;

    public NewsQuestionAnswerPK() {
    }

    public NewsQuestionAnswerPK(int questionid, int answerid) {
        this.questionid = questionid;
        this.answerid = answerid;
    }

    public int getQuestionid() {
        return questionid;
    }

    public void setQuestionid(int questionid) {
        this.questionid = questionid;
    }

    public int getAnswerid() {
        return answerid;
    }

    public void setAnswerid(int answerid) {
        this.answerid = answerid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) questionid;
        hash += (int) answerid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsQuestionAnswerPK)) {
            return false;
        }
        NewsQuestionAnswerPK other = (NewsQuestionAnswerPK) object;
        if (this.questionid != other.questionid) {
            return false;
        }
        if (this.answerid != other.answerid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsQuestionAnswerPK[questionid=" + questionid + ", answerid=" + answerid + "]";
    }

}
